home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Beginning Mac Programming
/
Beginning Mac Programming.bin
/
Open Me for REALbasic 3
/
REALbasic 3.2
/
Example Projects
/
Applications
/
SnackTracker
/
SnackTracker Example Read Me
< prev
next >
Wrap
Text File
|
1998-06-23
|
3KB
|
57 lines
SnackTracker 1.0 was created to keep track of employees' snack food purchases
at a quickly growing company of around 100 people. It writes purchase
information to a text file, "datafilepdtest," which serves as a database for
user information. Each line of the file holds a record, which includes six
fields, delineated by the pipe "|" symbol:
1) last name
2) first name
3) login
4) password (default is no password)
5) group (on payroll "Y" or not on payroll "N", for billing purposes)
6) amount due
The first record is a dummy record, with last name "Aaa." This file is treated
as binary data for reading and writing. In addition to the "datafile" file, the
"datafilebu" file serves as backup. (Aliases are used in the program's actual
implementation because a total of three machines are set up to run the application,
one in each of the company's three kitchens. All three write to the same four
files on a fourth machine, which acts as a server.)
Four peripheral files are required for proper functioning:
1) datafile (main database file)
2) datafilebu (backup file)
3) passadmin (to store the administrative password)
4) payrolltotals (to store totals due when submitted to accounting for
payroll deduction)
The user is able to enter his or her login, a password if one exists, and a
purchase amount. The password may be changed at any time by selecting the
"Change My Password" option under the "Passwords" menu. The user may also
view the current total due by selecting "What's My Total?" under the "Totals"
menu.
An administrator, with a separate password stored in the "passadmin" file
(which may also be changed at any time by selecting the "Change the
Admin Password" option under the "Accounting" menu), may add a new
user, delete a current user, credit user payment, and display current user
totals. There are different windows, each under "Accounting," for each of
these capabilities. The initial default value for the admin password in this
example is no password.
When the totals are displayed by selecting "Display Totals," the administrator
is also given the options to print the totals for reference only, or to print
the totals and set them for use when they're deducted from the employees'
paychecks. In the current implementation, the totals are set and printed for
delivery to the accounting department on the 15th of each month. When pay
deductions go into effect on the 20th, the administrator returns to the
program and selects the "Credit Payment" screen under "Accounting," and hits
the "Credit All Employees on Payroll" button. This reads from a file that was
written on the 15th when the totals were set, and goes through the stored
information, crediting the appropriate users. If no totals were set, the
administrator is informed that the file is empty. Manual entry of credited
totals is necessary if a user has been deleted between the time the totals are
set and the time the administrator attempts to credit all users on payroll.
No changes are necessary if a new user has been added, however -- the new
user's record will simply be skipped when totals are credited.
Beth Evans
beth@tera.com